package file;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class Test9 {
    public static void main(String[] args) {
        try (InputStream inputStream = new FileInputStream("test/test.txt")) {
            int len;
            byte[] buf = new byte[1024];
            while (true) {
                len = inputStream.read(buf);
                if (len == -1) {
                    break;
                }
                for (int i = 0; i < len; i++) {
                    System.out.printf("%c", buf[i]);
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
